package com.shaw.study.test.service;

import com.shaw.study.springx.annotation.Autowired;
import com.shaw.study.springx.annotation.Service;
import com.shaw.study.springx.annotation.Transaction;
import com.shaw.study.test.dao.IUserDao;
import com.shaw.study.test.dao.UserDao;

/**
 * Created by asus on 2018/4/26.
 */
@Service
public class DemoService implements IDemoService{
    IUserDao userdao = new UserDao();
    @Override
    public String getName(){

        return userdao.getUserName("1");
    }

    @Override
    @Transaction
    public boolean addUser(String id, String username) throws Exception {
        Boolean a = userdao.addUser(id,username);
        throw new Exception();
//        return a;
    }

    @Override
    public String toString() {
        return super.toString();
    }
}
